﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mendel
{
    public class Reference : Data
    {
        public Item Value { get; set; }

        public Reference(Item refenced)
        {
            Value = refenced;
        }

        public override DType Type
        {
            get { return DType.Reference; }
        }

        public override Data Clone()
        {
            return new Reference(Value);
        }

        public override Data Convert(DType to)
        {
            if (to == DType.Reference)
                return this;
            else
                return Value.DataDirectly.Convert(to);
        }
    }
}
